//
//  BrithDayView.m
//  WuJieLive
//
//  Created by 张瀚坤 on 2017/10/26.
//  Copyright © 2017年 zhk. All rights reserved.
//

#import "BrithDayView.h"

@implementation BrithDayView

-(void)awakeFromNib
{
    [super awakeFromNib];

}

- (IBAction)doneAction:(UIButton *)sender {
    
    if (!self.dateString) {
        NSDate * date = [NSDate date];
        NSDateFormatter * dateFormatter = [[NSDateFormatter alloc]init];
        dateFormatter.dateFormat = @"yyyy-MM-dd";
        self.dateString = [dateFormatter stringFromDate:date];
    }
    if (_dateBlock) {
        _dateBlock(self.dateString);
    }
    if (self.conBlock) {
        self.conBlock();
    }
}

- (IBAction)cancelAction:(UIButton *)sender {
    if (self.cancelBlock) {
        self.cancelBlock();
    }
}

- (IBAction)dateChanged:(UIDatePicker *)sender {

    NSDateFormatter * dateFormatter = [[NSDateFormatter alloc]init];
    dateFormatter.dateFormat = @"yyyy-MM-dd";
    
    self.dateString = [dateFormatter stringFromDate:sender.date];
}




@end
